package com.zijie.hosptal.pojo.po;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.springframework.validation.annotation.Validated;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
public class Admin {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @NotBlank
    @Size(min = 4,max = 20,message = "用户名长度在4-20之间")
    private String username;
    @NotBlank
    @Size(min = 3,max = 20,message = "密码长度在3-20之间")
    private String password;
    @TableField(condition = SqlCondition.LIKE,whereStrategy = FieldStrategy.NOT_EMPTY)
    private String name;
    @Pattern(regexp = "^1[0-9]{10}$", message = "手机号格式不正确")
    private String phone;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    private String createUser;
    private String updateUser;
}
